package com.phamkhanh.domain;

// default package
// Generated Oct 14, 2012 11:06:17 PM by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Gps generated by hbm2java
 */
@Entity
@Table(name = "gps", catalog = "findyourphone")
public class Gps implements java.io.Serializable {

	private Integer gid;
	private User user;
	private String longitude;
	private String latitude;
	private Date dateUpdate;

	public Gps() {
	}

	public Gps(User user, String longitude, String latitude, Date dateUpdate) {
		this.user = user;
		this.longitude = longitude;
		this.latitude = latitude;
		this.dateUpdate = dateUpdate;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "GID", unique = true, nullable = false)
	public Integer getGid() {
		return this.gid;
	}

	public void setGid(Integer gid) {
		this.gid = gid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UID", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "Longitude", nullable = false, length = 45)
	public String getLongitude() {
		return this.longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	@Column(name = "Latitude", nullable = false, length = 45)
	public String getLatitude() {
		return this.latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DateUpdate", nullable = false, length = 19)
	public Date getDateUpdate() {
		return this.dateUpdate;
	}

	public void setDateUpdate(Date dateUpdate) {
		this.dateUpdate = dateUpdate;
	}

	@Override
	public String toString() {
		return "Gps [gid=" + gid + ", longitude="
				+ longitude + ", latitude=" + latitude + ", dateUpdate="
				+ dateUpdate + "]";
	}
}
